<template>
	<view class="container">
		<view class="h86 fwb">问题和反馈</view>
		<textarea class="textArea" value="" @input="input" placeholder="请填写内容,至少填写10个字..." />
		<view class="btn " @click="submit" >提交</view>
	</view>
</template>

<script>
	export default {
		name:"",
		data() {
			return {
				content:''
			}
		},
		onShow() {
			
		},
		methods: {
			input(e){
				this.content = e.detail.value;
			},
			async submit(){
				let _this  =this;
				if(_this.content.length>10){
					uni.showToast({
						title:"请填写至少10个字",
						icon:"none"
					})
					return false;
				}
				let res =  await _this.$utils.request({
					url:"/patient/feedback/",
					method:"POST",
					data:{
						feedback:_this.content
					}
				})
				if(res.statusCode == 200){
					uni.showToast({
						title:"反馈成功！"
					})
					setTimeout(()=>{
						_this.$routeJump.back()
					},2000)
				}else{
					uni.showToast({
						title:"反馈失败！请重试",
						icon:'error'
					})
				}
			},
		}
	}
	
</script>

<style lang="scss" scoped>
	.container{
		background-color: #fff;
		padding: 20rpx;
	}
	.textArea{
		width:100%;
		height:260rpx;
		border-radius:16rpx;
		background-color: #F5F5F5;
		padding: 20rpx;
		margin: 40rpx 0;
	}
	.btn{
		width: 75%;
		height: 84rpx;
		line-height: 84rpx;
		margin: 0 auto 50rpx;
		border-radius: 50rpx;
		background-color: #ffb526;
		margin-top: 60rpx;
	}
</style>
